﻿@model WebshopHPWcore.Models.ReceiptViewModel
@using Microsoft.AspNetCore.Identity
@using WebshopHPWcore.Models
@using WebshopHPWcore.Controllers
@using Microsoft;
@{
    ViewData["Title"] = "Review uw aankoop";
}

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

<br />
<h2>Overzicht van uw bestelling</h2>
<br />
<h4>Overzicht winkelwagen</h4><br />

<table id="table" class="table table-bordered table-responsive table-hover table-striped">
    <tr></tr>
    @foreach (var item in Model.shoppingcart.CartItems)
    {
        <tr id="row-@item.CartItemId">
            <td>
                @item.Car.brand @item.Car.model
            </td>
            <td>
                €  @item.Car.price ,-
            </td>
            <td id="item-count-@item.CartItemId">
                Aantal: @item.Count
            </td>
        </tr>
    }
    <tr>
        <td>
            <b>Totaal</b>
        </td>
        <td id="cart-total">
            <b>€ @Model.shoppingcart.CartTotal ,-</b>
        </td>
        <td></td>
    </tr>
</table>
<br />

<h4>Vul hier uw persoonsgegevens in</h4><br />
<form asp-action="Checkout" method="post" id="form" name="form">
    <table id="table" class="table table-bordered table-responsive table-hover table-striped">
        <tr>
            <td>
                Naam:
            </td>
            <td>
                <input required name="Firstname" value="@Model.user.FirstName" placeholder="Voornaam" title="Voornaam" class="form-control" />
                <input name="Middlename" value="@Model.user.MiddleName" placeholder="Tussenvoegsel" title="Tussenvoegsel" class="form-control" />
                <input required name="Lastname" value="@Model.user.lastName" placeholder="Achternaam" title="Achternaam" class="form-control" />
            </td>
        </tr>
        <tr>
            <td>
                Adresgegevens:
            </td>
            <td>
                <input required name="Addres" value="@Model.user.Address" placeholder="Straatnaam" title="Adres" class="form-control" />
                <input required name="Housenr" value="@Model.user.HouseNumber" type="number" placeholder="Huisnummer" title="Huisnummer" class="form-control" />
                <input name="Toevoeging" type="text" placeholder="Toevoeging" title="Toevoeging" class="form-control" />
                <input required name="Zipcode" placeholder="Postcode" pattern="[1-9][0-9]{3}\s?[a-zA-Z]{2}" value="@Model.user.ZipCode" title="Postcode (4 cijfers + 2 letters)" class="form-control" />
                <input required name="City" placeholder="Woonplaats" value="@Model.user.City" title="Woonplaats" class="form-control" />
            </td>
        </tr>
        <tr>
            <td>
                Contactgegevens:
            </td>
            <td>
                <input id="Email" type="email" required name="Email" value="@Model.user.Email" placeholder="Email" title="Email" class="form-control" />
                <input type="tel" placeholder="Telefoonnummer" pattern="[0-9]{10}" title="Telefoonnummer" required name="Phonenr" value="@Model.user.PhoneNumber" class="form-control" />
            </td>
        </tr>
    </table>

    <div>
        <p>
            <label><input required type="checkbox" value="" /> Bovenstaande gegevens zijn correct ingevuld.</label>
        </p>
    </div>
    <br />

    <p >
        <a asp-controller="ShoppingCart" asp-action="Index" class="koop-knopje-links"><< Verder winkelen</a>
    </p>

    <input type="submit" class="koop-knopje" value="Verder naar bestellen >>" />
</form>

<br />